module.exports = app => {
    const {DOUBLE, DATE, STRING  ,INTEGER } = app.Sequelize;

    const User = app.model.define('t_users', {
        id: { type: INTEGER, primaryKey: true, autoIncrement: true },
        name: {type:STRING(20),'allowNull': false},
        phone:{type:DOUBLE(20,0),'allowNull': false},
        pwd:{type:STRING(30),'allowNull': false},
        idcard:{type:STRING(255),'allowNull': true},
        type:{type:DOUBLE(1,0),'allowNull': false},
        isdelete:{type:DOUBLE(1,0),'allowNull': false},
        createtime: {type:DATE,'allowNull': false},
        modifytime:{type:DATE,'allowNull': false},
        balance:{type:DOUBLE(20,0),'allowNull': false},
        openid:{type:STRING(200),'allowNull': false},
        area:{type:STRING(200),'allowNull': false},
        alipay:{type:STRING(200),'allowNull': false},
        state:{type:DOUBLE(1,0),'allowNull': false},
        earn:{type:DOUBLE(20,0),'allowNull': false},
        spreader:{type:DOUBLE(20,0),'allowNull': false},
        spreader_reg_earn:{type:DOUBLE(20,0),'allowNull': false},
        reg_earn:{type:DOUBLE(20,0),'allowNull': false},
        sex:{type:DOUBLE(1,0),'allowNull': false},
        age:{type:DOUBLE(3,0),'allowNull': false},
        invite:{type:STRING(255),'allowNull': false},
    },{
        timestamps: false,  //去除createAt updateAt
        freezeTableName: true,  //使用自定义表名
    });

    return User;
};
